<extend name="Public/base" />
<block name="content">
    <div class="row">
        <div class="col-md-12">
<!-- Horizontal Form -->
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">{$title}</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" method="post" action="__SELF__" id="ajaxForm01">
                <div class="box-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">昵称 (required)</label>
                        <div class="col-sm-10">
                            <input class=" form-control"  name="unick"  type="text"  value="{$info.unick}" placeholder="昵称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">电话 (required)</label>
                        <div class="col-sm-10">
                            <input class=" form-control"  name="tel"  type="text"  value="{$info.tel}" placeholder="电话"/>
                        </div>
                    </div>

                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <div class="row">
                       <div class="col-md-offset-4">
                           <notempty name="info.id">
                               <input type="hidden" name="id" value="{$info.id}"/>
                           </notempty>
                           <button type="reset" class="btn btn-default">取消</button>&nbsp;&nbsp;&nbsp;
                           <input type="submit" class="btn btn-info" value="提交" >&nbsp;&nbsp;&nbsp;
                           <a href="{:U('person/editPass')}" class="btn btn-info">修改密码</a>
                        </div>
                    </div>

                </div>
                <!-- /.box-footer -->
            </form>
        </div>
<!-- /.box -->
         </div>
    </div>

</block>
 <block name="js">
     <script>
         $( document ).ready( function () {
             $("#ajaxForm01").validate({
                 rules: {
                     unick: "required"
                 },
                 messages: {
                     unick: "昵称必填"
                 },
                 errorElement: "em",
                 errorPlacement: function (error, element) {
                     // Add the `help-block` class to the error element
                     error.addClass("help-block");

                     if (element.prop("type") === "checkbox") {
                         error.insertAfter(element.parent("label"));
                     } else {
                         error.insertAfter(element);
                     }
                 },
                 highlight: function (element, errorClass, validClass) {
                     $(element).parents("div").addClass("has-error").removeClass("has-success");
                 },
                 unhighlight: function (element, errorClass, validClass) {
                     $(element).parents("div").addClass("has-success").removeClass("has-error");
                 }
             });
         })
     </script>
 </block>